{if !$ajax}
{include(file='header.tpl')}
{if !$search_all}
	           <div id="searchform_container">
	               <h2>{$language_heading_search} "{$search_value}"</h2>
    	           <form id="search_form">
    	               <input type="text" value="" placeholder="{$language_input_placeholder_title}" name="title" id="t_title" />
    	               <select name="global" id="t_thema">
    	                   <option value="0">{$language_option_globaltopic}</option>
    	                   {foreach $arr_topics_global key item}
                           <option value="{$item.tag_name}">{$item.tag_name}</option>
                           {/foreach}
    	               </select>
    	               <select name="topic" id="t_thema2">
    	                   <option value="0">{$language_option_project}</option>
    	                   {foreach $arr_topics key item}
                           <option value="{$item.t_name}">{$item.t_name}</option>
                           {/foreach}
    	               </select>
    	               <select name="gebiet" id="t_gebiet">
    	                   <option value="0">{$language_option_region}</option>
    	                   {loop $arr_regions}
                           <option value="{$g_name}">{$g_name}</option>
                           {/loop}
    	               </select>
    	               <select name="ebene" id="t_ebene">
    	                   <option value="0">{$language_option_layer}</option>
                           {loop $arr_layers}
                           <option value="{$e_abbr}">{$e_name}</option>
                           {/loop}
    	               </select>
    	               <select name="verified" id="t_verified">
    	                   <option value="0">{$language_table_header_verified_data}</option>
    	                   <option value="{$language_verified_yes}">{$language_verified_yes}</option>
    	                   <option value="{$language_verified_no}">{$language_verified_no}</option>
    	               </select>
    	               <input type="submit" value="{$language_submit_filter}" />
    	               <input type="reset" value="{$language_reset_view_all}" />
    	           </form>
	           </div>
	           <div id="datatable_div">
    	           <table id="datatable">
    	               <tr>
    	                   <th class="t_title">{$language_table_header_title}</th>
    	                   <th class="t_thema">{$language_table_header_globaltopic}</th>
    	                   <th class="t_thema2">{$language_table_header_project}</th>
    	                   <th class="t_gebiet">{$language_table_header_region}</th>
    	                   <th class="t_ebene">{$language_table_header_layer}</th>
    	                   <th>{$language_table_header_creation_date}</th>
    	                   <th>{$language_table_header_author}</th>
    	                   <th class="t_verified">{$language_table_header_verified_data}</th>
    	               </tr>
    	               {loop $arr_datatables}
    	               <tr>
                          <td><a href="{$__.base_uri}index.php?input=map&amp;m_id={$dt_id}">{$dt_titel}</a></td>
                          <td>{$globaltopic}</td>
                          <td>{$t_name}</td>
                          <td>{$g_name}</td>
                          <td>{$e_name}<span class="skip">{$e_abbr}</span></td>
                          <td class="table_date">{date_format $dt_time "%d.%m.%Y"}</td>
                          <td class="table_date">{$dt_user}</td>
                          <td>{if $dt_verified_data}{$__.language_verified_yes}{else}{$__.language_verified_no}{/if}</td>
                        </tr>
                       {/loop}
    	           </table>
    	       </div>
{include(file='js.tpl')}
                <script type="text/javascript">
                /* <![CDATA[ */
                new Policies_Ui();
                /* ]]> */
                </script>
{else}
    <h2>{$language_heading_search_form}</h2>
    <form action="{$base_uri}index.php" method="get">
        <input type="hidden" name="input" value="search" />
        <input type="hidden" name="type" value="all" />
        <p>
            <label for="search_title">{$language_table_header_title}</label>
            <input type="text" name="search_title" id="search_title" value="{$arr_s_values.title}" />
        </p>
        <p>
            <label for="globaltopic">{$language_table_header_globaltopic}</label>:
            <select name="globaltopic" id="globaltopic">
                <option value="0">---</option>
                {foreach $arr_topics_global key value}
                    <option value="{$value.tag_id}"{if $value.tag_id == $arr_s_values.globaltopic} selected="selected"{/if}>{$value.tag_name}</option>
                {/foreach}
            </select>
        </p>
        <p>
            <label for="search_tag">{$language_table_header_tag}</label>:
            <select name="tag" id="search_tag">
                <option value="0">---</option>
                {foreach $arr_tags key value}
                    <optgroup label="{$value.tag_name}">{$value.tag_name}</option>
                    {foreach $value.children child_key child_value}
                        <option value="{$child_value.tag_id}"{if $child_value.tag_id == $arr_s_values.tag_id} selected="selected"{/if}>{$child_value.tag_name}</option>
                    {/foreach}
                    </optgroup>
                {/foreach}
            </select>
        </p>
        <p>
            <label for="search_layer">{$language_table_header_layer}</label>:
            <select name="layer" id="search_layer">
                <option value="0">---</option>
                {foreach $arr_layers key value}
                        <option value="{$value.e_id}"{if $value.e_id == $arr_s_values.layer_id} selected="selected"{/if}>{$value.e_name}</option>
                    </optgroup>
                {/foreach}
            </select>
        </p>
        <p>
            <label for="search_region">{$language_table_header_region}</label>:
            <select name="region" id="search_region">
                <option value="0">---</option>
                {foreach $arr_regions key value}
                        <option value="{$value.g_id}"{if $value.g_id == $arr_s_values.region_id} selected="selected"{/if}>{$value.g_name}</option>
                    </optgroup>
                {/foreach}
            </select>
        </p>
        <p><input type="submit" value="{$language_submit_search}" /></p>
    </form>
    {if $arr_datatables}
                <div id="datatable_div">
    	           <table id="datatable">
    	               <tr>
    	                   <th class="t_title">{$language_table_header_title}</th>
    	                   <th class="t_thema">{$language_table_header_globaltopic}</th>
    	                   <th class="t_thema2">{$language_table_header_project}</th>
    	                   <th class="t_gebiet">{$language_table_header_region}</th>
    	                   <th class="t_ebene">{$language_table_header_layer}</th>
    	                   <th>{$language_table_header_creation_date}</th>
    	                   <th>{$language_table_header_author}</th>
    	                   <th>{$language_table_header_tag}</th>
    	                   <th>{$language_table_header_verified_data}</th>
    	               </tr>
    	               {loop $arr_datatables}
    	               <tr>
                          <td><a href="{$__.base_uri}index.php?input=map&amp;m_id={$dt_id}">{$dt_titel}</a></td>
                          <td>{$globaltopic}</td>
                          <td>{$t_name}</td>
                          <td>{$g_name}</td>
                          <td>{$e_name}<span class="skip">{$e_abbr}</span></td>
                          <td class="table_date">{date_format $dt_time "%d.%m.%Y"}</td>
                          <td class="table_date">{$dt_user}</td>
                          <td class="table_date">{$tag_name}</td>
                          <td class="table_date">{if $dt_verified_data}{$__.language_verified_yes}{else}{$__.language_verified_no}{/if}</td>
                        </tr>
                       {/loop}
    	           </table>
    	       </div>
    	   {else}
    	   <h3>{$language_search_no_result}</h3>
    	   {/if}
{/if}
{include(file='footer.tpl')}
{/if}
